<div class="users index">
	<h2><?php echo __('Users');?></h2>
	<p>
		<?php echo $this->Html->link('Novo Usuário', array('controller'=>'users', 'action'=>'add'), array('class'=>'btn btn-primary'));?>
	</p>
	<table class="table table-hover table-striped">
	<thead>
		<tr>
				<th width="25px"><?php echo $this->Paginator->sort('id_users');?></th>
				<th><?php echo $this->Paginator->sort('username');?></th>
				<th><?php echo $this->Paginator->sort('nome');?></th>
				<th><?php echo $this->Paginator->sort('empresas_id');?></th>
				<th class="actions" width="250px"><?php echo __('Actions');?></th>
		</tr>
	</thead>
	<tbody>
	<?php
	$i = 0;
	foreach ($users as $user): ?>
	<tr>
		<td><?php echo h($user['User']['id_users']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['username']); ?>&nbsp;</td>
		<td><?php echo h($user['User']['nome']); ?>&nbsp;</td>
		<td>
			<?php echo $this->Html->link($user['Empresa']['nome'], array('controller' => 'empresas', 'action' => 'view', $user['Empresa']['id_empresas'])); ?>
		</td>
		<td>
			<div class="btn-toolbar">
				<div class="btn-group">
					<?php echo $this->Html->link("<i class='icon-search'></i>", array('action' => 'view', $user['User']['id_users']), array('class'=>'btn', 'escape'=>false, 'title'=>__('Ver'))); ?>
					<?php echo $this->Html->link("<i class='icon-edit'></i>", array('action' => 'edit', $user['User']['id_users']), array('class'=>'btn', 'escape'=>false, 'title'=>__('Editar'))); ?>
					<?php echo $this->Form->postLink("<i class='icon-trash'></i>", array('action' => 'delete', $user['User']['id_users']), array('class'=>'btn', 'escape'=>false, 'title'=>__('Apagar')), __('Are you sure you want to delete # %s?', $user['User']['id_users'])); ?>
				</div>
			</div>
		</td>
	</tr>
<?php endforeach; ?>
	</tbody>
	</table>
	<p class="text-info text-center">
	<?php
	echo $this->Paginator->counter(array(
	'format' => __('Page {:page} of {:pages}, showing {:current} records out of {:count} total, starting on record {:start}, ending on {:end}')
	));
	?>	</p>

	<div class="pagination pagination-centered">
		<ul>
			<?php echo $this->Paginator->prev(
				'< '.__('Anterior'),
				array('tag' => 'li', 'class' => 'prev'),
				'<a>< '.__('Anterior').'</a>',
				array('tag' => 'li', 'escape' => false, 'class' => 'prev disabled')
			);?>
			<?php echo $this->Paginator->numbers(array('separator' => '', 'tag'=>'li', 'currentTag'=>'a', 'currentClass'=>'active')); ?>
			<?php echo $this->Paginator->next(
				__('Próximo'). ' >',
				array('tag' => 'li', 'class' => 'prev'),
				'<a>'.__('Próximo').' ></a>',
				array('tag' => 'li', 'escape' => false, 'class' => 'prev disabled')
			);?>
		</ul>
	</div>
</div>